import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView,
    // },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
    {
      path: '/',

      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/LoginView.vue'),
    },

    {
      path: '/MainView',
      component: () => import('../views/MainView.vue'),
      children: [
        {
          path: '',
          redirect: '/MainView/AddPermission'
        },
        {
          path: 'AddPermission',
          name: 'AddPermission',
          component: () => import('../views/AddPermissionView.vue'),
        },
        {
          path: 'PermissionList1',
          name: 'PermissionList1',
          component: () => import('../views/PermissonList1.vue'),
        },
        {
          path: 'PermissonDetail',
          name: 'PermissonDetail',
          component: () => import('../views/PermissonDetail.vue'),
        },
        {
          path: 'RoleManage',
          name: 'RoleManage',
          component: () => import('../views/RoleManageView.vue'),
        },
        {
          path: 'AddRoleView',
          name: 'AddRoleView',
          component: () => import('../views/AddRoleView.vue'),
        },
        {
          path: 'EditRoleView',
          name: 'EditRoleView',
          component: () => import('../views/EditRoleView.vue'),
        },
        {
          path: 'RoleUserView',
          name: 'RoleUserView',
          component: () => import('../views/RoleUserView.vue'),
        },
        {
          path: 'AddUserView',
          name: 'AddUserView',
          component: () => import('../views/AddUserView.vue'),
        },
        {
          path: 'AddUserRolePermissonView',
          name: 'AddUserRolePermissonView',
          component: () => import('../views/AddUserRolePermissonView.vue'),
        },
        {
          path: 'GetBasicView',
          name: 'GetBasicView',
          component: () => import('../views/Traceability/GetBasicView.vue'),
        },

        {
          path: '/TraceabilityDetail',
          name: 'TraceabilityDetail',
          component: () => import('../views/Traceability/TraceabilityDetail.vue'),
        },



      ]
    },

  ],
})

export default router
